package com.apes.scm.masterdata.party.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = SupplierUserLog.CONST_TABLE_NAME)
public class SupplierUserLog extends BaseModel {
    public static final String CONST_TABLE_NAME = "mas_supplier_user_log";

    @Id
    @Column(name = "id", length = 64)
    @Comment("id")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "序列码")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "supplier_id", referencedColumnName = "ID", nullable = false)
    @Comment("供应商")
    private  PartyRole supplier;

    @Column(name = "creator_id", length = 64)
    @Comment("创建人")
    private String creator;

    @Column(name = "phone", length = 64)
    @Comment("电话号码")
    private String phone;

    @Column(name="origin", length = 30)
    private String origin; //操作帐号
}
